/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.crm.action.sale.contacts;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.crm.mapper.sale.contacts.PotentialCustomerRightsMapper;
public class PotentialCustomerRights extends BaseAction
{
    @Autowired(required=false)
	private PotentialCustomerRightsMapper mapper;
    /**
    潜在客户联系人权限
    */
    
    public Map potentialCustomerRights() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_user=mapper.t_user(params);
        SQLMap t_user_emt=t_user.getExistfirst();
        result.put("t_user", t_user_emt);
        
        return result;
    }
    /**
    选择联系人权限
    */
    
    public Map limitationChooseContacts() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_area=mapper.s_area(params);
        result.put("s_area", s_area);
        
        
        SQLList<SQLMap> s_type_area_client=mapper.s_type_area_client(params);
        result.put("s_type_area_client", s_type_area_client);
        
        return result;
    }
    /**
    */
    
    public Map disable() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.disable(params);
        
        return result;
    }
    /**
    选择联系人权限修改
    */
    
    public Map limitationChooseContactsSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int d_type_area = mapper.d_type_area(params);
        result.put("d_type_area", d_type_area);
        
        
        for (SQLMap emt:hqlBean.getTableElements("type_authority")){
            params=new SQLParam(request,emt.getMap());
            mapper.i_type_area(params);
        }
        
        return result;
    }
}